﻿using UnityEngine;
using System.Collections;

public class audio_cont : MonoBehaviour {
    AudioSource as01;
    public AudioClip ac01;
    public AudioClip ac02;

	void Start () {
        as01 = GetComponent<AudioSource>();
	}
	
	// Update is called once per frame
	void Update () {
        if (Input.GetKeyDown(KeyCode.P))
        {
            as01.Play();
        }
        if (Input.GetKeyDown(KeyCode.O))
        {
            as01.Stop();
        }
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            as01.clip = ac01;
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            as01.clip = ac02;
        }
        if (Input.GetKeyDown(KeyCode.Minus))
        {
            as01.volume -= 0.1f;
        }
        if (Input.GetKeyDown(KeyCode.Equals))
        {
            as01.volume += 0.1f;
        }
        as01.volume += Input.GetAxis("Mouse ScrollWheel") * 0.1f;

    }
}
